<?php
include("connect.php");
$sql="SELECT Activities.ActID,ActName,User.UserName FROM Activities,User,Contact where Contact.ActID=Activities.ActID  AND Contact.UserID=User.UserID  AND Contact.Identity=1" ;
mysqli_query($conn,"set names utf8mb4");
$result=mysqli_query($conn,$sql);
$data=Array();
class activity{
	public $ActID;
	public $ActName;
	public $UserName;
}
while($row=mysqli_fetch_array($result,MYSQL_ASSOC)){
	$act=new activity();
	$act->ActID=urlencode($row["ActID"]);
	$act->ActName=urlencode($row["ActName"]);
	$act->UserName=urlencode($row["UserName"]);
	$data[]=$act;
}
$json=json_encode($data);
echo urldecode($json);
?>
